import junit.framework.TestCase;


public class TaliaTest extends TestCase{
	
	Talia talia;
	
	public void setUp() {
        talia= new Talia();
        talia.tasuj();
	}
	
	public void testoddaj(){
		talia.karty[1][0] = 1;
		talia.karty[0][0] = 78;
		talia.oddaj(78);
		int a = talia.karty[1][0];
		assertSame(0, a);
	}
	
	public void testwygral(){
		int gracze[] = new int[6];
		int w_rundzie[][] = new int[6][2];
		int karty[][] = new int[6][4];
		karty[0][0] = 1;
		karty[0][1] = 1;
		karty[0][2] = 1;
		karty[0][3] = 1;
		karty[1][0] = 2;
		karty[1][1] = 2;
		karty[1][2] = 2;
		karty[1][3] = 2;
		karty[2][0] = 1;
		karty[2][1] = 2;
		karty[2][2] = 3;
		karty[2][3] = 4;
		karty[3][0] = 1;
		karty[3][1] = 2;
		karty[3][2] = 2;
		karty[3][3] = 1;
		karty[4][0] = 1;
		karty[4][1] = 1;
		karty[4][2] = 3;
		karty[4][3] = 4;
		karty[5][0] = 5;
		karty[5][1] = 6;
		karty[5][2] = 7;
		karty[5][3] = 8;
		
		
		int a[] = talia.wygral(karty, 6, gracze, w_rundzie);
		assertSame(a[0], 2);
		gracze[2] = 1;
		int aa[] = talia.wygral(karty, 6, gracze, w_rundzie);
		//assertSame(aa[0], 5);
		
	}
	
	public void testIwygral(){
		int gracze[] = new int[6];
		int w_rundzie[][] = new int[6][2];
		int karty[][] = new int[6][4];
		karty[0][0] = 1;
		karty[0][1] = 1;
		karty[0][2] = 1;
		karty[0][3] = 1;
		karty[1][0] = 2;
		karty[1][1] = 2;
		karty[1][2] = 2;
		karty[1][3] = 2;
		karty[2][0] = 1;
		karty[2][1] = 2;
		karty[2][2] = 3;
		karty[2][3] = 4;
		karty[3][0] = 1;
		karty[3][1] = 2;
		karty[3][2] = 2;
		karty[3][3] = 1;
		karty[4][0] = 1;
		karty[4][1] = 1;
		karty[4][2] = 3;
		karty[4][3] = 4;
		karty[5][0] = 5;
		karty[5][1] = 6;
		karty[5][2] = 7;
		karty[5][3] = 8;
		
		gracze[2] = 1;
		int a[] = talia.wygral(karty, 6, gracze, w_rundzie);
		assertSame(a[0], 5);
		
	}
	
	public void testIIwygral(){
		int gracze[] = new int[6];
		int w_rundzie[][] = new int[6][2];
		int karty[][] = new int[6][4];
		karty[0][0] = 1;
		karty[0][1] = 1;
		karty[0][2] = 1;
		karty[0][3] = 1;
		karty[1][0] = 2;
		karty[1][1] = 2;
		karty[1][2] = 2;
		karty[1][3] = 2;
		karty[2][0] = 1;
		karty[2][1] = 2;
		karty[2][2] = 3;
		karty[2][3] = 4;
		karty[3][0] = 1;
		karty[3][1] = 2;
		karty[3][2] = 2;
		karty[3][3] = 1;
		karty[4][0] = 1;
		karty[4][1] = 1;
		karty[4][2] = 3;
		karty[4][3] = 4;
		karty[5][0] = 5;
		karty[5][1] = 6;
		karty[5][2] = 7;
		karty[5][3] = 8;
		
		gracze[2] = 1;
		gracze[5] = 1;
		int a[] = talia.wygral(karty, 6, gracze, w_rundzie);
		assertSame(a[0], 4);
		
	}
	
	

}
